package Test;

import static org.junit.Assert.assertEquals;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;
import java.util.function.Function;
import java.util.logging.Handler;
import java.util.stream.Stream;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;


public class TestParameterized {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        String[] list1={"哇哈哈","想拍阿姐","天天","阿发圣诞节","天天"};
        ArrayList<String> list = new ArrayList<>();
       list.addAll(Arrays.asList(list1));

       list.stream().map( a->{
                                if (a.length()>3) {
                                    return a;
                                }
                                return null;
                               }).forEach(System.out::println);
    }
    @Test
    public void test1(){
        Function<Integer, Integer> fun = res -> res + 1;
        Integer  i = fun.apply(2);
        System.out.println(i);
    }
}
class SayHello implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("HELLO");
//            try {
//                Thread.sleep(1000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
        }

    }
}
class SayWorld implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("world");
//            try {
//                Thread.sleep(1000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
        }

    }
}